#!/bin/bash
set -v

commitId=$(git rev-parse --short HEAD)
version=$(date '+%y%m%d-%H%M')

PRJNAME=guoke-front
TARNAME=${PRJNAME}${version}.tar
IMAGE_TAG=${PRJNAME}:${version}

rm -rf ./guoke-front*.tar
pnpm build
docker build -f ./docker/Dockerfile -t ${IMAGE_TAG} ./dist --platform=linux/amd64
docker save ${IMAGE_TAG} -o ${TARNAME}

echo $IMAGE_TAG